package top.fangw.admin.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.fangw.admin.service.ISysUserJoinOrgService;
import top.fangw.common.api.vo.InitUserJoinOrgVo;
import top.fangw.common.core.result.Result;

/**
 * <p>
 * 用途：存储用户和机构的关联信息 前端控制器
 * </p>
 *
 * @author fangw
 * @since 2024-03-02
 */
@Tag(name = "用户与机构的关联关系")
@RestController
@RequestMapping("/sys-user-join-org")
@RequiredArgsConstructor
public class SysUserJoinOrgController {
    private final ISysUserJoinOrgService sysUserJoinOrgService;

    @Operation(summary = "初始化用户与机构的关联关系")
    @PostMapping("/initUserJoinOrg")
    public Result<?> initUserJoinOrg(@RequestBody InitUserJoinOrgVo initUserJoinOrg){
        sysUserJoinOrgService.initUserJoinOrg(initUserJoinOrg);
        return Result.success();
    }

}
